#!/bin/zsh
# This is a theme for oh-my-zsh by Saroth Wong

local green="%{$fg[green]%}"
local red="%{$fg[red]%}"
local cyan="%{$fg[cyan]%}"
local yellow="%{$fg[yellow]%}"
local blue="%{$fg[blue]%}"
local magenta="%{$fg[magenta]%}"
local gray="%{$fg[gray]%}"
local white="%{$fg[white]%}"
local reset="%{$reset_color%}"
local foreground="%{$fg[white]%}"
local background="%{$bg[gray]%}"
local bold="%{$fg_bold[white]%}"
local clean="${reset}${background}"

local timestamp='$(date +%m%d_%H%M%S)'
user() {
    str="${blue}"
    if [[ "$(whoami)" == 'root' ]]; then
        str="${red}"
    fi
    echo "${str}%n"
}
local at="${clean}@${bold}"
local host="${blue}%m"
local in="${clean}:${bold}"
local dir="${cyan}%~"
local on="${clean}(${bold}"
local with="${clean})"
local promp="%(?:${white}:${red})>"

# Format for git_prompt_info()
ZSH_THEME_GIT_PROMPT_PREFIX="${on}${green}"
ZSH_THEME_GIT_PROMPT_SUFFIX="${with}"
# Format for parse_git_dirty()
ZSH_THEME_GIT_PROMPT_DIRTY=""
ZSH_THEME_GIT_PROMPT_CLEAN=""
# Format for git_prompt_status()
ZSH_THEME_GIT_PROMPT_UNMERGED="${red}&"
ZSH_THEME_GIT_PROMPT_DELETED="${red}-"
ZSH_THEME_GIT_PROMPT_RENAMED="${yellow}#"
ZSH_THEME_GIT_PROMPT_MODIFIED="${yellow}*"
ZSH_THEME_GIT_PROMPT_ADDED="${green}+"
ZSH_THEME_GIT_PROMPT_UNTRACKED="${red}?"
ZSH_THEME_GIT_PROMPT_STASHED="${magenta}$"

PROMPT='${background}[ '
PROMPT+=${timestamp}
PROMPT+=' '
PROMPT+='${bold}$(user)${at}${host}${in}${dir}'
PROMPT+='$(git_prompt_info)$(git_prompt_status)'
PROMPT+='${clean} ]${reset} ${ZSH_CMD_TIME_DECORATE}
'
PROMPT+='${background}${promp}'
PROMPT+=' ${reset}'

